package com.hspedu.mhl.service;

import com.hspedu.mhl.dao.CompanionsDao;
import com.hspedu.mhl.domain.Companions;

import java.util.List;

public class CompanionsService {
    private CompanionsDao dao = new CompanionsDao();

    //返回一个同伴清单
    public List<Companions> getCompanions() {
        return dao.queryMulti("select *from companions", Companions.class);
    }

    //给BillService提供一个方法，得到money这一数据
    public Object getCompanionsmoney(int companion_id) {
        Object queriedScalar = dao.queryScalar("select price from companions where id=?",
                companion_id);
        return queriedScalar;
    }
}
